<!--
 * @Descripttion: 字典公共组件
 * @version: V1.0
 * @Author: GW
 * @Date: 2021-09-02 15:04:15
 * @LastEditors: GW
 * @LastEditTime: 2021-09-02 17:06:26
-->
<template>
    <div>
        <a-radio-group name="radioGroup" :default-value="1">
            <a-radio :value="1">
                A
            </a-radio>
            <a-radio :value="2">
                B
            </a-radio>
            <a-radio :value="3">
                C
            </a-radio>
            <a-radio :value="4">
                D
            </a-radio>
        </a-radio-group>

        <a-select default-value="lucy" style="width: 120px" @change="handleChange">
            <a-select-option value="jack">
                Jack
            </a-select-option>
            <a-select-option value="lucy">
                Lucy
            </a-select-option>
            <a-select-option value="disabled" disabled>
                Disabled
            </a-select-option>
            <a-select-option value="Yiminghe">
                yiminghe
            </a-select-option>
        </a-select>
    </div>
</template>

<script>
import { typeList, typeSave, typeDelete, typeEnable, typeDisable } from "@/api/dictType";
import { keyList, keySave, keyDelete, keyEnable, keyDisable } from "@/api/dictData";


export default {
    data () {
        return {
            showType: null,//显示类型
            listData: [],//所有字典
        }
    },
    methods: {
        getList () {
            //获取所有字典列表
            let postData = {
                "page.current": 1,
                "page.size": -1
            };
            this.loading = true;
            typeList(postData).then(response => {
                if (response.code === 200) {
                    this.loading = false;

                    const { data } = response;
                    const { records, total, current, size } = data;
                    this.listData = records;
                    this.listData.forEach(item => {
                        item.key = item.id;
                    });
                }
            }).catch(error => { });
        },
        getdetailsList () {
            //获取某个字典明细
            let requestData = {
                dictTypeId: this.orderId
            };
            keyList(requestData).then(response => {
                if (response.code === 200) {

                    this.dataSource = response.data.records;
                } else {
                    this.$message.error(response.message);
                }
            }).catch(e => {
                // this.isSaveRun = true;
            });
        },
    }
}
</script>

<style>
</style>
